package ca.etsmtl.log730.projet2.connectors.msg;

import java.io.Serializable;
import java.util.UUID;

import ca.etsmtl.log730.projet2.connectors.clientserver.RequestManager;
import ca.etsmtl.log730.projet2.connectors.clientserver.nodes.DocumentMap;

public abstract class Request implements Serializable, Comparable<Request> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -9034885627244031056L;

	
	private UUID id = UUID.randomUUID();

	private Integer ordinal = -1;

	public UUID getId() {
		return id;
	}


	public void setId(UUID id) {
		this.id = id;
	}
	
	public void apply(DocumentMap dm) {
		
	}


	public Integer getOrdinal() {
		return ordinal;
	}


	public void setOrdinal(Integer ordinal) {
		this.ordinal = ordinal;
	}


	@Override
	public int compareTo(Request r) {
		return ordinal - r.ordinal;
	}



	public abstract RequestReply createRequestReply(RequestManager rm);


}
